/*
 * @Date: 2022-02-23 15:50:49
 * @LastEditors: wuyuxin
 * @LastEditTime: 2022-02-23 17:13:27
 * @FilePath: \webpack-learning\26_自定义Loader\webpack.config.js
 * @description: 文件描述
 */
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
  mode: "development",
  entry: {
    main: "./src/main.js"
  },
  devtool: "source-map",
  output: {
    filename: "bundle.js",
    path: path.resolve(__dirname, "./build")
  },
  module: {
    rules: [
      // {
      //   test: /\.js$/i,
      //   use: [
      //     "hy-loader01",
      //     "hy-loader02",
      //     "hy-loader03",
      //   ]
      // },
      // {
      //   test: /\.js$/i,
      //   use: {
      //     loader: "hy-loader01",
      //     options: {
      //       test: "test",
      //     }
      //   }
      // },
      // {
      //   test: /\.js$/i,
      //   use: "hy-loader02",
      //   enforce: "post"
      // },
      // {
      //   test: /\.js$/i,
      //   use: "hy-loader03",
      // },
      {
        test: /\.js$/i,
        use: "hybabel-loader",
      },
      {
        test: /\.md$/i,
        use: [
          "html-loader",
          "hymd-loader"
        ]
      }
    ]
  },
  resolveLoader: {
    modules: ["node_modules", "./loaders"]
  },
  plugins: [
    new HtmlWebpackPlugin()
  ]
}